package com.ccys.app.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccys.app.feignClient.NettyFeignService;
import com.ccys.app.service.AppVersionService;
import com.ccys.app.service.CommonService;
import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.entity.TblAppVersion;
import com.ccys.db.mapper.TblAppVersionMapper;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.app.launchingTheApp.VersionMake;
import com.ccys.db.vo.app.launchingTheApp.VersionVo;
import feign.Request;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;



@Service
public class CommonServiceImpl  implements CommonService {
    @Autowired
    private NettyFeignService nettyFeignService;


    @Override
    public ResponseResultApp sendWebSocketMessage(String booking_id, String event_name, Object event_data, String event_action) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("booking_id",booking_id);
        jsonObject.put("event_name",event_name);
        jsonObject.put("event_data",event_data);
        jsonObject.put("event_action",event_action);
        this.nettyFeignService.sendMessageWebSocket(new Request.Options(6000, 6000), booking_id,jsonObject.toJSONString(), "ok");
        return ResponseResultApp.success();
    }
}
